A computer system or the like may execute code such as an operating system (OS) and one or more user applications. In some conventional systems, a user application may store data, which is to be transmitted (e.g., from the computer system) in a packet, in a user buffer and perform an OS call. In response to the OS call, the OS may form header data for the packet and copy the user application data from the user buffer to an OS buffer so that the user application data serves as payload data of the packet.
The OS may ensure that accurate header data is placed in the packet. However, copying the user application data into the OS buffer to form the packet requires time, thereby increasing latency. Consequently, some other conventional systems may employ a method, such as TCP/IP acceleration, that enables a user application to form the packet header and payload data, thereby avoiding the data copy to an OS buffer and reducing latency. However, if user applications are enabled to form packets, accuracy of header data placed in the packet may not be ensured. For example, a malicious user application may spoof header data of the packet being formed (e.g., so as to mimic association with another connection). Consequently, improved methods and apparatus for transmitting packets of data are desired.